import request from '@/utils/request'

// 查询维保任务列表
export function listMaintenance(query) {
  return request({
    url: '/business/maintenance/list',
    method: 'get',
    params: query
  })
}

// 查询维保任务详细
export function getMaintenance(id) {
  return request({
    url: '/business/maintenance/' + id,
    method: 'get'
  })
}

// 新增维保任务
export function addMaintenance(data) {
  return request({
    url: '/business/maintenance',
    method: 'post',
    data: data
  })
}

// 修改维保任务
export function updateMaintenance(data) {
  return request({
    url: '/business/maintenance',
    method: 'put',
    data: data
  })
}

// 删除维保任务
export function delMaintenance(id) {
  return request({
    url: '/business/maintenance/' + id,
    method: 'delete'
  })
}

// 获取维保任务的总数量和已完成维保任务的数量
export function getMaintenanceCount() {
  return request({
    url: '/business/maintenance/count',
    method: 'get'
  })
}